package com.kingdee.eas.custom.hr.attendance.app;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.bos.util.BOSUuid;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.custom.hr.attendance.ApproveStateEnum;
import com.kingdee.eas.custom.hr.attendance.ExceptionStateEnum;
import com.kingdee.eas.custom.hr.attendance.OverTimeReviewFactory;
import com.kingdee.eas.custom.hr.attendance.OverTimeReviewInfo;
import com.kingdee.eas.custom.hr.attendance.OvertimeManagement36EntryInfo;
import com.kingdee.eas.custom.hr.attendance.OvertimeManagement36Factory;
import com.kingdee.eas.custom.hr.attendance.OvertimeManagement36Info;
import com.kingdee.eas.hr.base.HRBillBaseEntryInfo;
import com.kingdee.eas.hr.base.HRBillStateEnum;
import com.kingdee.eas.hr.base.app.HRBillBizBean;

public class OvertimeManagement36BizBean extends HRBillBizBean {

	public void _addnew(Context arg0, IObjectPK arg1, IObjectValue arg2)
			throws BOSException, EASBizException {

	}

	public void _beforeEffectBeforeBackJob(Context arg0,
			HRBillBaseEntryInfo arg1) throws BOSException, EASBizException {

	}

	public void _beforeEffectOnBackJob(Context arg0, HRBillBaseEntryInfo arg1)
			throws BOSException, EASBizException {

	}

	public void _beforeEffectOnNoJob(Context arg0, HRBillBaseEntryInfo arg1)
			throws BOSException, EASBizException {

	}

	public void _check(Context arg0, IObjectPK arg1, IObjectValue arg2)
			throws BOSException, EASBizException {

	}

	public void _delete(Context arg0, IObjectPK arg1) throws BOSException,
			EASBizException {

	}

	public void _entryEffect(Context ctx, HRBillBaseEntryInfo entry)
			throws BOSException, EASBizException {
		OvertimeManagement36EntryInfo info = (OvertimeManagement36EntryInfo) entry;

		OvertimeManagement36Info billInfo = OvertimeManagement36Factory
				.getLocalInstance(ctx).getOvertimeManagement36Info(
						new ObjectUuidPK(info.getBill().getId().toString()));

		OverTimeReviewInfo review = new OverTimeReviewInfo();
		review.setPerson(info.getPerson());
		review.setOverTimeType(billInfo.getOverTimeType());
		review.setExceptionState(ExceptionStateEnum.EXCEPTION);
		review.setApproveState(ApproveStateEnum.NOT_APPROVE);
		review.setLogBeginTime(info.getOvertimeBeginTime());
		review.setLogEndTime(info.getOvertimeEndTime());
		review.setSumUnit(info.getSumUnit());
		review.setOverTimeBill(billInfo.getId().toString());
		review.setOption(0);
		review.setLogLong(info.getSumLong());
		OverTimeReviewFactory.getLocalInstance(ctx).save(review);
	}

	public void _processBeforeAddNew(Context context, IObjectValue iobjectvalue)
			throws BOSException, EASBizException {
		// TODO Auto-generated method stub

	}

	public void _setBillState(Context context, BOSUuid bosuuid,
			HRBillStateEnum hrbillstateenum) throws BOSException,
			EASBizException {
		// TODO Auto-generated method stub

	}

	public void _update(Context context, IObjectPK iobjectpk,
			IObjectValue iobjectvalue) throws BOSException, EASBizException {
		// TODO Auto-generated method stub

	}
}
